//
//  ProductHomeTableViewCell.m
//  ShoppingExperience
//
//  Created by LiYinDi on 15/7/22.
//  Copyright (c) 2015年 RuiBen. All rights reserved.
//

#import "ProductHomeTableViewCell.h"
#import "UIImageView+WebCache.h"

@implementation ProductHomeTableViewCell
@synthesize dataArray;
- (void)awakeFromNib {
    // Initialization code
   
}
- (void)setImageIcon{
    float viewHeight=0.0f;
    for (int i=0; i<dataArray.count; i++) {
        UIButton *imageButton=[UIButton buttonWithType:UIButtonTypeCustom];
        //
        //        sampleImageView.layer.borderColor=[[UIColor colorWithRed:239.0f/255.0f green:239.0f/255.0f blue:239.0f/255.0f alpha:1] CGColor];
        //        sampleImageView.layer.borderWidth= 1.0f;
        //        sampleImageView.layer.cornerRadius=3;
        CGRect rect=imageButton.frame;
        imageButton.tag=i+1;
        rect.size.height=85;
        rect.size.width=85;
        rect.origin.x=25+(85+25)*(i%6);
        rect.origin.y=17+85*(i/6);
        // NSLog(@"i/6=====%d",i/5);
        imageButton.frame=rect;
        viewHeight=rect.origin.y+rect.size.height+15;
        //  [imageButton addTarget:self action:@selector(imageButtonClick:) forControlEvents:UIControlEventTouchUpInside];
        UIImageView *sampleImageView=[[UIImageView alloc] initWithFrame:imageButton.frame];
        sampleImageView.tag=i+1+100;
        [sampleImageView setImageWithURL:[NSURL URLWithString:[dataArray objectAtIndex:i]]];
       
        [_view1 addSubview:sampleImageView];
        [_view1 addSubview:imageButton];
        
        
        
    }
    CGRect frame=_view1.frame;
    frame.size.height=120*dataArray.count/6;
    _view1.frame=frame;
    
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
